The present invention relates to a storage device and a storage subsystem comprised of the storage device and a storage controller.
In addition to a disk device, a magnetic tape or an optical storage device is often used as a storage device in a computer system. Recently, a digital video disk (DVD) has particularly been highlighted.
The DVD is a storage medium suitable for storing data of a large scale such as a voice, an image or a moving picture. As the need for processing large scale data in multi-media increases, realization of increasing performance,increasing reliability and increasing availability is much thought of.
A literature xe2x80x9cA Case for Redundant Arrays of Inexpensive Disks (RAID)xe2x80x9d by D. Patterson et al, ACM SIGMOD conference proceeding, Chicago, Ill., Jun. 1-3, 1988, pp. 109-116 discloses a technique for data arrangement on a disk array.
The disk array is a mechanism for realization of increasing performance and increasing reliability in a disk system. In the disk array, to meet increasing performance, disk devices which are physically plural in number impersonate a single disk device for a processor unit. On the other hand, to meet increasing reliability, check information or redundant data for recovering data in the event that a disk device storing the data becomes faulty is stored in a different disk device.
Usually, data behaving as a read/write unit in the disk device is called a record and in the literature by Patterson, some methods for record arrangement are proposed. In the case where the disk array is used, however, a data length of a record representing a read/write unit as viewed from the processor unit sometimes differs from a data length of a record which is actually recorded in the disk device. Hereinafter, the former will be called a logical record and the latter will be called a physical record.
In the storage disk such as disk device, an error correcting code (ECC) serving as a code for error correction is added every constant recording unit when data is stored in a storage medium, thereby improving the reliability. For example, in a disk device of small computer system interface (SCSI), ECC""s are generated and added to data at intervals of individual data pieces of 512 bytes and in the DVD, they are generated and added to data at intervals of individual data pieces of 32 kbytes.
Accordingly, when data of desired size written by the data processor unit is written into the storage medium, an amount of data by which the written data is short of the ECC generation unit must once be read from the storage medium to a buffer, the read-out data must be combined with the write data to permit an ECC to be generated, and the combined data and the ECC must be written to the storage medium. Consequently, a long time is required for the write processing.
A similar problem arises in an instance where the technique of redundant arrays of inexpensive disk (RAID) is applied to storage devices.
In the RAID, consecutive data written by the data processor unit is divided into a plurality of physical records , which are stored in corresponding storage media. These physical records to be stored will hereinafter be called data records. Then, check information pieces or redundant data pieces are generated in association with the plurality of data records and a check information piece is stored in a physical record of a different storage medium. Hereinafter, the check information is called a parity, the physical record for storing the parity is called a parity record and a gang of the parity record and some corresponding data records is called a parity group.
In the RAID, too, when the data record and the parity record are to be stored in the corresponding storage media, ECC""s are generated and added. At that time, if the physical record does not neatly fill up the ECC generation unit, a shortage of data must be read out of the storage medium. For example, on the assumption that the physical data size is 80 kbytes in the case of a DVD having an ECC generation unit of 32 kbytes, ECC""s can be generated for initial 64 kbytes by using only write data but for the remaining 16 kbytes, data or parity of 16 kbytes corresponding to a shortage must be read out of the storage medium.
As will be seen from the above, in operation of write to the storage device such as DVD, data or parity short of the ECC generation unit must be read out of the storage medium and consequently, data which is essentially superfluous must be transferred. Disadvantageously, this degrades the performance of the whole of the storage subsystem when the load on the storage device increases.
An object of the present invention is to increase the performance of the processing of write to a storage device in which ECC""s are generated.
According to the present invention, to accomplish the above object, in the processing of write to a storage device in which an ECC is generated for data of a predetermined unit during data storage, data written by a data processor unit is not immediately written to a storage medium but write to the storage medium is deferred until data of an ECC generation unit becomes complete in the form of write data. As a result, an ECC can be generated and written to the storage medium by using only write data without reading a shortage of data from the storage medium.
Especially, in the case of consecutive data of a large scale handled by a DVD, the probability that write data transmitted from the data processor unit is followed by consecutive data which is consecutively written and with the above data schedule, almost all data pieces can be written to storage media without resort to superfluous read operation of data.
Controlling write operation such that the write operation is deferred until data of the ECC generation unit becomes complete or filled up may be effected by the data processor unit or the storage device without using the storage controller.
Similarly, in the RAID, by making the physical record size a multiple of the ECC generation unit, ECC""s can be generated for data records for which generation of a parity is complete and for a parity record by using only data on the buffer and can be written to the storage device.
As described above, according to the present invention, the amount of data to be transferred during data write operation can be decreased and increasing performance can be ensured in the storage device such as DVD and in the storage subsystem in which the RAID technique is applied to the storage device such as DVD.